import {request, uploadFile} from '@/util/request.js'

//获取案件类别
export const getcaseType = (data) => request({url: '/szcg/common/dict/selectSysDict/sbj_type',method: 'get'})

//通过案件类型获取案件大类
export const getcategoryName = (data) => request({url: '/szcg/common/dict/eventTypelv1/' + data.type,method: 'get'})

//获取小类
export const getsubclassName = (data) =>  request({url: '/szcg/common/dict/eventTypelv2/' + data.parentId,method: 'get'})

//获取立案条件
export const eventTypelv3 = (data) => request({url: '/szcg/common/dict/eventTypelv3/'+ data.parentId,method: 'get'})

//获取曲江边界
export const getQjBjMapData = (data) => request({url: '/szcg/common/dict/getQjBjMapData',method: 'get'})


//通过二类名获取二类级
export const getArchivesTypeLeveTwoByName = (data) => request({url: `/archives/archivesTypeLeve/getArchivesTypeLeveTwoByName?levelTwoName=${data.levelTwoName}`,method: 'get'})

//获取是否转办数据接口
export const getIseventData = (data) => request({url: '/szcg/common/dict/getEventStatus',method: 'get'});

//获取事件 来源接口
export const getArchivesData = (data) => request({url: '/szcg/common/dict/selectSysDict/szcg_archives_src',method: 'get'})

//获取安装状态接口
export const getEventStatusLv2 = (data) => request({url: '/szcg/common/dict/getEventStatusLv2/'+ data.parentId,method: 'get'})

//字典
export const getDics = (data) => request({url: `/szcg/common/dict/selectSysDict/${data.type}`, method: 'get'})

//通过部门获取一级行业列表
export const getArchivesIndustryTypeLv1s = data => request({url: `/szcg/common/dict/getArchivesIndustryTypeLv1/${data.deptCode}`, method: 'get'})

//通过一级行业id获取二级行业列表
export const getArchivesIndustryTypeLv2ByLv1Ids = data => request({url: `/szcg/common/dict/getArchivesIndustryTypeLv2ByLv1Id/${data.lv1Id}`, method: 'get'})

//通过二级行业类别查找负责的标段机构公司
export const getCompanys = data => request({url: `/szcg/common/dict/getCompanyByIndustryType2?industryTypeId=${data.industryTypeId }`})

//加水点
//消防栓点位列表
export const getSXCBList = (data) => request({url: `/app/sxcb/getSXCBList`, data});

//查周
export const selectWeekYear = (data) => request({url: `/app/sxcb/selectWeekYear`, data});

//加水点位详情
export const getSXCBInfoById = (data) => request({url: `/app/sxcb/getSXCBInfoById`, data});

//加水点检查
export const checkSXCB = (data) => request({url: `/app/sxcb/addSXCB_check`, data, method: 'POST'});

//查询巡检员网格
export const queryCheckRegion = data => request({url: `/szcg/app/event/xjyRegion/${data.userId}`});

///高德地图区划边界
export const getRegions = data => request({url: `/szcg/common/dict/getQjBjMapData`, data: data});

//获取任务部署列表
export const querySzbmJsdBusinessList = data => request({url: '/app/jsd/getSzbmJsdBusinessList', data: data, method: 'GET'});

//获取历史事中任务详情
export const querySzbmJsdBusinessMiddle = data => request({url: '/app/jsd/getSzbmJsdBusinessMiddleById', data: data, method: 'GET'});

//获取历史事前任务详情
export const querySzbmJsdBusiness = data => request({url: '/app/jsd/getSzbmJsdBusinessById', data: data, method: 'GET'});

//获取积水点列表
export const queryMiddleJsdList = data => request({url: '/app/jsd/getMiddleJsdList', data: data, method: 'GET'});

//获取积水点列表
export const queryJsdList = data => request({url: '/app/jsd/getJsdList', data: data, method: 'GET'});

//获取历史事前详情雨水篦子详情
export const querySzbmJsdHistory = data => request({url: '/app/jsd/getSzbmJsdHistoryByBusinessId', data: data, method: 'GET'});

//通过任务部署id和积水点id获取事中任务上报
export const queryTaskDetail = data => request({ url: '/app/jsd/getSzbmJsdBusinessMiddleReportByBusinessIdAndjsdId', data: data});

//通过任务id和积水点id获取是否事前上报过
export const queryCheckIsReport = data => request({ url: `/app/jsd/getCheckIsReportByBusinessIdAndjsdId`, data: data });

//添加事前任务
export const insertSzbmJsdBusinessBefore = data => request({url: `/app/jsd/insertSzbmJsdBusinessBefore`, data: data, method: 'POST'});

//添加事前任务--视频
export const insertSzbmJsdBusinessBeforeVideo = (data, tempFilePath)=> uploadFile({url: `/app/jsd/insertSzbmJsdBusinessBeforeVideo`, data: data, tempFilePath: tempFilePath});

//添加事中任务上报
export const insertSzbmJsdBusinessMiddleReport = data => request({url: `/app/jsd/insertSzbmJsdBusinessMiddleReport`, data: data, method: 'POST'});

//添加事前任务--视频
export const insertSzbmJsdBusinessMiddleReportVideo = (data, tempFilePath)=> uploadFile({url: `/app/jsd/insertSzbmJsdBusinessMiddleReportVideo`, data: data, tempFilePath: tempFilePath});

//上传用户Gps
export const addUserGps = (data) => request({url: `/business/app/event/addUserGps`, data, method: 'POST', hideLoading: true});

//
export const getClockInInfo = (data = {}) => request({url: `/business/app/clockin/getClockInInfo`, data});

//获取token
export const getAgoraRTMToken = (data) => request({url: `/jsd/app/shengwangtoken/getShengWangRTMToken`, data, isAuth: false});

//获取token
export const getShengWangRTCToken = (data) => request({url: `/jsd/app/shengwangtoken/getShengWangRTCToken`, data, isAuth: false});

//app端视频通话推送消息给PC端
export const sendWebsocket = (data) => request({url: `/jsd/app/shengwangtoken/sendWebsocket`,data, method: 'POST', isAuth: false});
